<!--
 * @Author: your name
 * @Date: 2020-03-26 16:39:37
 * @LastEditTime: 2020-03-29 18:59:37
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-imooc-ebook\src\components\ebook\EbookTitle.vue
 -->
<template>
  <transition name="slide-down">
      <div class="title-wrapper" v-show="menuVisible">
        <div class="left">
          <span class="icon-back" @click="back"></span>
        </div>
        <div class="right">
          <div class="icon-wrapper" @click="toStore">
            <span class="icon-shelf"></span>
          </div>
        </div>
      </div>
    </transition>
</template>

<script>
import { ebookMixin } from '../../utils/mixin'
export default {
  mixins: [ebookMixin],
  methods: {
    back () {
      // console.log('back')
      // 返回到上一级，获取到一个路由
      this.$router.go(-1)
    },
    toStore() {
      this.$router.push('/store/shelf')
    }
  }
}
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
  @import "../../assets/styles/global";
  .title-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 200;
    display: flex;
    width: 100%;
    height: px2rem(90);//48
    background: white;
    box-shadow: 0 px2rem(8) px2rem(8) rgba(0, 0, 0, .15);
    font-size: px2rem(50);//20
    .left {
      flex: 0 0 px2rem(60);//60
      @include left;
      margin-left: px2rem(20);//15
    }
    .right {
      flex: 1;
      display: flex;
      justify-content: flex-end;
      .icon-wrapper {
        flex: 0 0 px2rem(70);//40
        @include center;
        .icon-shelf {
          font-size: px2rem(50);//22
        }
        .icon-cart {
          font-size: px2rem(50);//22
        }
      }
    }
  }
</styleg="scss">
